home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
MacWorld: Complete Mac Interactive
/
Macworld Complete Mac Interactive CD)(1994).iso
/
The Best of BMUG
/
Utilities
/
Text and Speech
/
Alpha.5.76
/
Tcl
/
UserCode
/
selectFunc.tcl
< prev
next >
Wrap
Text File
|
1994-03-08
|
1KB
|
51 lines
# FILE: selectFunc.tcl
#
# LAST UPDATE: 2/1/93 12:15:28 PM
#
# selectFunc - similar to searchFunc, but selects the entire definition
# COPYRIGHT:
#
# Copyright © 1993 by David C. Black
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by David C. Black.
#
# THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#
#############################################################################
proc selectFunc {dir} {
global funcExpr
set pos [getPos]
select $pos
if {$dir==1} {
incr pos
} else {
set pos [expr $pos-1]
}
if {[catch {eval select [search -f $dir -i 1 -r 1 $funcExpr $pos]}]} {
beep
message "No more functions"
} else {
set pos [getPos]
set end [selEnd]
if {[catch {eval select [search -f 1 -i 1 -r 1 $funcExpr $end]}]} {
select $pos [maxPos]
} else {
set end [getPos]
select $pos $end
}
}
}
#endproc selectFunc
##############################################################################